<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body id="father">
    <h1>标题一</h1>
    <p id="p1">p1</p>
    <p class="p2">p2</p>
    <div id="1"></div>
<!-- 1.innerText='123'  修改文本内容
    1.innerHTML='<strong>123</strong>'  可以解析HTML文件
    1.style.color = 'red';   操作js
-->
    <script>
        var h1 = document.getElementsByTagName('h1');
        var p1 = document.getElementById('p1');
        var p2 = document.getElementsByClassName('p2');
        var father = document.getElementById('father');
        var childrens = father.children;//获取父节点下的所有子节点

    </script>
</body>
</html>